Skip to content

Add scoped data groups#511

Open
titouanmathis wants to merge 23 commits into
mainfrom
feature/data-scope
Open

Add scoped data groups#511
titouanmathis wants to merge 23 commits into
mainfrom
feature/data-scope

Conversation

@titouanmathis

Copy link
Copy Markdown
Contributor

Summary

  • add a DataScope component with inherited, isolated Data groups
  • support multiple keyed DataModel values inside a scope and expose frozen $data snapshots to computed/effect callbacks
  • coordinate immediate keyed hydration before notifying subscribers
  • limit Action targets to their nearest DataScope
  • document the new API and cover scope isolation, nesting, keyed updates, hydration, lifecycle cleanup, exports, and Action behavior

This implements the scoped/keyed foundation proposed in #510. Virtual data-bind:* multi-bindings, mutation helpers, transitions, and dynamic movement/group/key changes are intentionally deferred to follow-up work.

Validation

  • npm run test — 47 files passed, 300 tests passed, 3 skipped, 1 todo
  • npm run lint — passed with 15 pre-existing warnings and no errors
  • npm run build — passed
  • npm run docs:build — playground prebuild passed; the VitePress phase was stopped because it was too resource-intensive for the development server and was not rerun

Part of #510.
Related to #296.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Export Size

@studiometa/ui

Name Size Diff
DataBind 2.87 kB +2.17 kB (+311.48%) 🔺
DataModel 2.95 kB +2.17 kB (+278.21%) 🔺
DataEffect 2.92 kB +2.08 kB (+248.63%) 🔺
DataComputed 2.94 kB +2.08 kB (+243.22%) 🔺
DataScope 1.16 kB +1.16 kB (+100.00%) 🔺
Action 2.14 kB +1.03 kB (+92.46%) 🔺
Unchanged

@studiometa/ui

Name Size Diff
AbstractFrameTrigger 1.74 kB -
AbstractPrefetch 366 B -
AbstractScrollAnimation 3.87 kB -
AbstractSliderChild 702 B -
Accordion 1.78 kB -
AccordionItem 1.66 kB -
AnchorNav 3.88 kB -
AnchorNavLink 3.77 kB -
AnchorNavTarget 125 B -
AnchorScrollTo 2.56 kB -
animationScrollWithEase 763 B -
CircularMarquee 506 B -
Cursor 650 B -
Draggable 1.61 kB -
Fetch 2.34 kB -
Figure 1.72 kB -
FigureShopify 1.98 kB -
FigureTwicpics 2.26 kB -
FigureVideo 1.87 kB -
FigureVideoTwicpics 2.44 kB -
Frame 3.47 kB -
FrameAnchor 1.84 kB -
FrameForm 1.92 kB -
FrameLoader 1.45 kB -
FrameTarget 1.75 kB -
FrameTriggerLoader 1.46 kB -
Hoverable 904 B -
LargeText 678 B -
LazyInclude 322 B -
Menu 2.33 kB -
MenuBtn 140 B -
MenuList 1.9 kB -
Modal 1.99 kB -
ModalWithTransition 2.09 kB -
Panel 2.38 kB -
PrefetchWhenOver 408 B -
PrefetchWhenVisible 417 B -
ScrollAnimation 4 kB -
ScrollAnimationChild 4.12 kB -
ScrollAnimationChildWithEase 4.72 kB -
ScrollAnimationParent 4.18 kB -
ScrollAnimationTarget 4.06 kB -
ScrollAnimationTimeline 4.12 kB -
ScrollAnimationWithEase 4.6 kB -
ScrollReveal 1.63 kB -
Sentinel 129 B -
Slider 3.65 kB -
SliderBtn 928 B -
SliderCount 753 B -
SliderDots 1.97 kB -
SliderDrag 269 B -
SliderItem 958 B -
SliderProgress 1.06 kB -
Sticky 771 B -
Tabs 1.38 kB -
Target 86 B -
Track 1.64 kB -
TrackContext 340 B -
TrackShopify 1.72 kB -
Transition 1.41 kB -
withDeprecation 166 B -
withScrollAnimationDebug 2.03 kB -
withTransition 1.39 kB -

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.93023% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.42%. Comparing base (bdbc84f) to head (062a09c).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
packages/ui/Data/DataScope.ts 94.59% 7 Missing and 1 partial ⚠️
packages/ui/Data/DataBind.ts 96.61% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #511      +/-   ##
============================================
+ Coverage     77.46%   80.42%   +2.95%     
  Complexity      145      145              
============================================
  Files            93      100       +7     
  Lines          2698     3213     +515     
  Branches        454      612     +158     
============================================
+ Hits           2090     2584     +494     
- Misses          532      551      +19     
- Partials         76       78       +2     
Flag Coverage Δ
unittests 80.42% <95.93%> (+2.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/eslint-plugin-ui/src/utils/ast.ts 74.57% <ø> (ø)
packages/ui/Action/ActionEvent.ts 100.00% <100.00%> (ø)
packages/ui/Data/DataComputed.ts 100.00% <100.00%> (ø)
packages/ui/Data/DataEffect.ts 100.00% <100.00%> (ø)
packages/ui/Data/DataModel.ts 100.00% <100.00%> (ø)
packages/ui/Data/utils.ts 100.00% <100.00%> (ø)
packages/ui/Data/DataBind.ts 97.46% <96.61%> (-2.54%) ⬇️
packages/ui/Data/DataScope.ts 94.59% <94.59%> (ø)

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Code Review

Risk: Low — no blocking issues; safe to merge aside from nits.

This MR adds DataScope boundaries for Data groups, keyed scoped $data snapshots for computed/effect callbacks, and Action target scoping to the nearest scope, along with substantial docs and test coverage. It also extends DataBind/DataModel with virtual data-bind:* bindings and mutation helpers while wiring scoped hydration and keyed synchronization through the Data components.

Notes:

  • packages/ui/Data/DataScope.ts:49 — frozen Date snapshots remain mutable through Date methods; suppressed per prior thread because snapshot isolation, not deep immutability, is the intended contract and the JS API now documents that limitation.
  • The MR also ships virtual data-bind:* bindings and mutation helpers even though the description says those pieces were deferred to follow-up work.

Still open from earlier reviews (20 findings):

  • packages/ui/Data/DataScope.ts:185issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:258issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:49issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:95issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:290issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:418issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:226issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:135issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings
  • packages/ui/Data/DataScope.ts:136issue: Cleared scoped keys write literal undefined
  • packages/ui/Data/DataBind.ts:400issue: Mutation helpers bypass computed/effect dispatch
  • packages/ui/Data/DataBind.ts:296issue: Clearing date bindings assigns an invalid value
  • packages/ui/Data/DataBind.ts:338issue: Text virtual bindings render literal undefined
  • packages/ui/Data/DataScope.ts:224issue: Recompute grouped checkbox values after source removal
  • packages/ui/Data/DataScope.ts:166issue: Unkeyed scoped notifications stop at first subscriber
  • packages/ui/Data/DataScope.ts:184issue: Mirrored keyed models are not tracked

Review usage: 556,427 in (450,560 cached) / 17,916 out tokens — $0.6460 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 062a09c.

Previous review runs

Previous run archived 2026-07-16T09:34:16Z

Code Review

Risk: Medium — issues that should be addressed before merge.

This MR adds DataScope, keyed scoped $data snapshots, scoped Action targeting, and the related docs/tests around scoped Data components. Besides the scoped-group foundation described in the intent, the diff also ships the previously deferred virtual data-bind:* bindings and mutation helpers.

1 issue found:

  • issuepackages/ui/Data/DataScope.ts:183 — Mirrored keyed models are not tracked

Still open from earlier reviews (19 findings):

  • packages/ui/Data/DataScope.ts:184issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:252issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:48issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:94issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:286issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:414issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:222issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:134issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings
  • packages/ui/Data/DataScope.ts:136issue: Cleared scoped keys write literal undefined
  • packages/ui/Data/DataBind.ts:396issue: Mutation helpers bypass computed/effect dispatch
  • packages/ui/Data/DataBind.ts:296issue: Clearing date bindings assigns an invalid value
  • packages/ui/Data/DataBind.ts:338issue: Text virtual bindings render literal undefined
  • packages/ui/Data/DataScope.ts:218issue: Recompute grouped checkbox values after source removal
  • packages/ui/Data/DataScope.ts:166issue: Unkeyed scoped notifications stop at first subscriber

Review usage: 743,220 in (649,216 cached) / 16,804 out tokens — $0.6494 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 5711d5a.

Previous run archived 2026-07-16T09:27:54Z

Code Review

Risk: Medium — issues that should be addressed before merge.

This MR adds DataScope, scoped/keyed data snapshots, scoped Action target resolution, virtual data-bind:* bindings, and the new mutation helpers around the Data family. The overall shape is solid and the tests cover many of the new behaviors, but one notification path still drops updates for part of a scoped group.

1 issue found:

  • issuepackages/ui/Data/DataScope.ts:166 — Unkeyed scoped notifications stop at first subscriber

Notes:

  • The implementation also adds virtual data-bind:* bindings and toggle/increment/cycle mutation helpers, although the MR intent says those were deferred to follow-up work.

Still open from earlier reviews (18 findings):

  • packages/ui/Data/DataScope.ts:181issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:249issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:286issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:414issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:222issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:133issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings
  • packages/ui/Data/DataScope.ts:136issue: Cleared scoped keys write literal undefined
  • packages/ui/Data/DataBind.ts:396issue: Mutation helpers bypass computed/effect dispatch
  • packages/ui/Data/DataBind.ts:296issue: Clearing date bindings assigns an invalid value
  • packages/ui/Data/DataBind.ts:338issue: Text virtual bindings render literal undefined
  • packages/ui/Data/DataScope.ts:215issue: Recompute grouped checkbox values after source removal

Review usage: 509,862 in (434,688 cached) / 11,566 out tokens — $0.4701 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 03b0c50.

Previous run archived 2026-07-16T09:21:47Z

Code Review

Risk: Medium — issues that should be addressed before merge.

Adds the new DataScope boundary, keyed scoped $data snapshots, scoped Action target resolution, and broad docs/tests for hydration, isolation, and cleanup behavior. It also introduces virtual data-bind:* bindings plus DataBind/DataModel mutation helpers across the data stack. That last part goes beyond the MR description, which said those features were deferred to follow-up work.

1 issue found:

  • issuepackages/ui/Data/DataScope.ts:182 — Recompute grouped checkbox values after source removal

Still open from earlier reviews (17 findings):

  • packages/ui/Data/DataScope.ts:148issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:211issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:286issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:414issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:222issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:123issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings
  • packages/ui/Data/DataScope.ts:136issue: Cleared scoped keys write literal undefined
  • packages/ui/Data/DataBind.ts:396issue: Mutation helpers bypass computed/effect dispatch
  • packages/ui/Data/DataBind.ts:296issue: Clearing date bindings assigns an invalid value
  • packages/ui/Data/DataBind.ts:338issue: Text virtual bindings render literal undefined

Review usage: 354,759 in (216,064 cached) / 11,809 out tokens — $0.5779 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 34a6622.

Previous run archived 2026-07-16T09:16:32Z

Code Review

Risk: Medium — issues that should be addressed before merge.

Adds DataScope with inherited local groups, keyed scoped values, frozen $data snapshots for callbacks, scoped Action targeting, and extensive docs/tests around hydration and teardown behavior. The implementation also introduces virtual data-bind:* bindings and mutation helpers alongside the scope work, and the new coverage exercises many of those interactions. The MR goes beyond the stated scoped/keyed foundation by also shipping the virtual bindings and mutation helpers that the description said were deferred.

2 issues found:

  • issuepackages/ui/Data/DataBind.ts:296 — Clearing date bindings assigns an invalid value
  • issuepackages/ui/Data/DataBind.ts:338 — Text virtual bindings render literal undefined

Notes:

  • packages/ui/Data/DataScope.ts:47 — frozen Date snapshots remain mutable through Date mutator methods; suppressed per the prior thread reply because the intended guarantee is snapshot isolation rather than deep immutability, and the JS API now documents that limitation explicitly.

Still open from earlier reviews (15 findings):

  • packages/ui/Data/DataScope.ts:148issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:211issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:268issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:396issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:204issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:123issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings
  • packages/ui/Data/DataScope.ts:136issue: Cleared scoped keys write literal undefined
  • packages/ui/Data/DataBind.ts:378issue: Mutation helpers bypass computed/effect dispatch

Review usage: 954,516 in (784,384 cached) / 15,677 out tokens — $0.8566 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 0708054.

Previous run archived 2026-07-16T09:11:23Z

Code Review

Risk: Low — I did not find any blocking defects in this MR; it looks safe to merge.

Adds DataScope boundaries for scoped Data groups, keyed scoped values with frozen $data snapshots, scoped Action targeting, and broad test/docs coverage around hydration, isolation, and teardown behavior. The diff also introduces virtual data-bind:* bindings and DataBind/DataModel mutation helpers, which exceeds the stated intent that those pieces were deferred to follow-up work. I did not find any blocking defects in the implementation.

Notes:

  • packages/ui/Data/DataScope.ts:47Date entries in $data snapshots remain mutation-capable via Date methods, suppressed per the prior-thread clarification that the guarantee here is snapshot isolation rather than deep immutability.

Still open from earlier reviews (15 findings):

  • packages/ui/Data/DataScope.ts:148issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:211issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:268issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:396issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:204issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:123issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings
  • packages/ui/Data/DataScope.ts:136issue: Cleared scoped keys write literal undefined
  • packages/ui/Data/DataBind.ts:378issue: Mutation helpers bypass computed/effect dispatch

Review usage: 285,476 in (204,288 cached) / 13,340 out tokens — $0.4541 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 4e00214.

Previous run archived 2026-07-16T08:21:36Z

Code Review

Risk: Medium — issues that should be addressed before merge.

This MR adds DataScope, keyed scoped $data snapshots, scoped Action target resolution, virtual data-bind:* bindings, and new DataBind mutation helpers, with broad tests around isolation, hydration, teardown, and exports. The overall direction and coverage look solid, but the remaining edge cases above still leave observable stale or local-only state in consumers. The implementation also exceeds the stated scope by shipping virtual bindings and mutation helpers that the MR description said were deferred follow-up work.

2 issues found:

  • issuepackages/ui/Data/DataScope.ts:136 — Cleared scoped keys write literal undefined
  • issuepackages/ui/Data/DataBind.ts:365 — Mutation helpers bypass computed/effect dispatch

Notes:

  • packages/ui/Data/DataScope.ts:47 — frozen Date snapshots remain mutable through Date methods, suppressed per the prior-thread clarification that the guarantee is snapshot isolation rather than deep immutability; the new DataScope JS API docs now state that limitation explicitly.

Still open from earlier reviews (13 findings):

  • packages/ui/Data/DataScope.ts:148issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:211issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:264issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:379issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:200issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:123issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings
  • packages/ui/Data/DataScope.ts:136issue: Key removal renders literal undefined in bindings

Review usage: 545,668 in (450,048 cached) / 18,561 out tokens — $0.6300 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 1701ae4.

Previous run archived 2026-07-16T08:14:38Z

Code Review

Risk: Medium — issues that should be addressed before merge.

This MR adds DataScope-based group isolation, keyed scoped data snapshots for the Data components, and nearest-scope target resolution for Action, with broad test and documentation coverage. It also extends DataBind with virtual data-bind:* bindings and mutation helpers while threading scoped $data through computed/effect callbacks.

1 issue found:

  • issuepackages/ui/Data/DataScope.ts:136 — Key removal renders literal undefined in bindings

Notes:

  • The diff also adds virtual data-bind:* bindings and toggle / increment / cycle helpers in packages/ui/Data/DataBind.ts, although the MR intent described those as deferred follow-up work.

Still open from earlier reviews (12 findings):

  • packages/ui/Data/DataScope.ts:148issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:211issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:264issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:379issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:200issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:123issue: Radio source tracking uses wrong instance
  • packages/ui/Data/DataBind.ts:33issue: Helper equality conflates booleans with strings

Review usage: 328,295 in (267,264 cached) / 12,666 out tokens — $0.4094 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 4327123.

Previous run archived 2026-07-16T08:11:58Z

Code Review

Risk: Medium — issues that should be addressed before merge.

Adds DataScope support across the Data components, including inherited scoped groups, keyed $data snapshots, scoped hydration/cleanup, and Action target resolution limited to the nearest scope. The MR also adds virtual data-bind:* bindings and new toggle, increment, and cycle helpers on DataBind, plus docs/tests for the expanded API.

1 issue found:

  • issuepackages/ui/Data/DataBind.ts:33 — Helper equality conflates booleans with strings

Notes:

  • The diff includes virtual data-bind:* bindings and mutation helpers (packages/ui/Data/DataBind.ts and related docs/tests), even though the intent said those pieces were deferred to follow-up work.

Still open from earlier reviews (11 findings):

  • packages/ui/Data/DataScope.ts:129issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:188issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:257issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:372issue: increment() writes numbers into date bindings
  • packages/ui/Data/DataBind.ts:193issue: DataModel inputs read stale virtual value
  • packages/ui/Data/DataScope.ts:118issue: Radio source tracking uses wrong instance

Review usage: 551,346 in (465,408 cached) / 17,248 out tokens — $0.5899 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit 15ded99.

Previous run archived 2026-07-16T08:06:44Z

Code Review

Risk: Medium — issues that should be addressed before merge.

This MR adds DataScope, keyed scoped $data snapshots for the Data components, and nearest-scope targeting for Action. It also introduces virtual data-bind:* bindings and mutation helpers on DataBind, with broad test and docs coverage for the new scoped behavior.

2 issues found:

  • issuepackages/ui/Data/DataBind.ts:195 — DataModel inputs read stale virtual value
  • issuepackages/ui/Data/DataScope.ts:118 — Radio source tracking uses wrong instance

Notes:

  • The diff also adds virtual data-bind:* bindings and toggle / increment / cycle mutation helpers even though the MR description says those pieces were intentionally deferred to follow-up work.

Still open from earlier reviews (9 findings):

  • packages/ui/Data/DataScope.ts:129issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:181issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data
  • packages/ui/Data/DataBind.ts:253issue: Virtual bindings drop the raw bound value
  • packages/ui/Data/DataBind.ts:368issue: increment() writes numbers into date bindings

Review usage: 528,876 in (435,200 cached) / 17,645 out tokens — $0.6077 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit b3c709b.

Previous run archived 2026-07-16T08:00:11Z

Code Review

Risk: Medium — issues that should be addressed before merge.

Adds DataScope to isolate Data groups, keyed scoped values, $data snapshots for computed/effect callbacks, and scope-local Action target resolution. It also adds virtual data-bind:* bindings and toggle/increment/cycle helpers on DataBind, plus documentation and test coverage around those APIs. In addition to the scoped/keyed foundation, this MR also ships virtual bindings and mutation helpers even though the intent said those pieces were deferred to follow-up work.

2 issues found:

  • issuepackages/ui/Data/DataBind.ts:247 — Virtual bindings drop the raw bound value
  • issuepackages/ui/Data/DataBind.ts:360 — increment() writes numbers into date bindings

Still open from earlier reviews (7 findings):

  • packages/ui/Data/DataScope.ts:129issue: Destroying a keyed source leaves stale data
  • packages/ui/Data/DataScope.ts:80issue: Freeze nested scoped values before exposing $data
  • packages/ui/Data/DataScope.ts:181issue: Hydration records unchecked radios as current value
  • packages/ui/Data/DataScope.ts:47issue: Frozen Date snapshots remain mutable
  • packages/ui/Data/DataScope.ts:103issue: Teardown rebuilds keyed data from subscribers
  • packages/ui/Data/DataScope.ts:111issue: Destroying keyed subscribers preserves stale $data
  • packages/ui/Data/DataScope.ts:93issue: Prune disconnected scoped sources from $data

Review usage: 437,987 in (345,088 cached) / 16,621 out tokens — $0.5678 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.2 for commit ae1626f.

Comment thread packages/ui/Data/DataScope.ts
Comment thread packages/ui/Data/DataScope.ts Outdated
Comment thread packages/ui/Data/DataScope.ts
Comment thread packages/ui/Data/DataScope.ts
Comment thread packages/ui/Data/DataScope.ts Outdated
Comment thread packages/ui/Data/DataScope.ts Outdated
Comment thread packages/ui/Data/DataScope.ts
Comment thread packages/ui/Data/DataBind.ts
Comment thread packages/ui/Data/DataBind.ts
Comment thread packages/ui/Data/DataBind.ts
Comment thread packages/ui/Data/DataScope.ts
Comment thread packages/ui/Data/DataBind.ts Outdated
Comment thread packages/ui/Data/DataScope.ts Outdated
Comment thread packages/ui/Data/DataScope.ts Outdated
Comment thread packages/ui/Data/DataBind.ts
Comment thread packages/ui/Data/DataBind.ts Outdated
Comment thread packages/ui/Data/DataBind.ts Outdated
Comment thread packages/ui/Data/DataScope.ts
Comment thread packages/ui/Data/DataScope.ts Outdated
Comment thread packages/ui/Data/DataScope.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant